package Observer_Strategy;

/**
 * 具体策略A
 */
public class ConservativeStrategy implements StockPriceStrategy {
    @Override
    public void applyStrategy(double price) {
        System.out.println("保守策略：股价变化幅度小于 1% 时不做操作");
        if (price > 1.01) {
            System.out.println("执行买入操作");
        } else if (price < 0.99) {
            System.out.println("执行卖出操作");
        } else {
            System.out.println("保持观望");
        }
    }
}
